package cn.gok.util;

import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;

import java.util.HashMap;
import java.util.Map;

//token缓存工具类
public class TokenCashUtil {
    public static final String TOKEN_="TOKEN";

    //存5分钟
    public static TimedCache<String ,String >tokenCash= CacheUtil.newTimedCache(1000*60*5);




    public static void putToken(String tokenName,String tokenValue){
        tokenCash.put(tokenName,tokenValue);
    }
    public void removeToken(String tokenName){
        tokenCash.remove(tokenName);
    }
    public static String getToken(String token){
        return tokenCash.get(token);
    }
}
